home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Hyper
/
Rinaldi
/
HC 1.2 & 2.0
/
TextRes 1.4.cpt
/
TextRes 1.4 (US)
/
card_3055.txt
< prev
next >
Wrap
Text File
|
1992-05-05
|
4KB
|
143 lines
-- card: 3055 from stack: in.4 (US)
-- bmap block id: 3273
-- flags: 0000
-- background id: 2661
-- name:
-- part 1 (field)
-- low flags: 01
-- high flags: 0007
-- rect: left=69 top=68 right=252 bottom=434
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 5 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=174 top=281 right=311 bottom=343
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: TextRes
----- HyperTalk script -----
on mouseUp
ask "Resource text :" with "This is a sample text"
if it is empty then exit mouseUp
put it into Text
ask "Resource type :" with "TEXT"
if it is empty then exit mouseUp
put it into Type
answer "Add resource in :" with "Cancel" or "Other file" or "This stack"
if it is "Cancel" then exit mouseUp
if it is "Other file"
then
if last word of the version ‚â• 2.0
then answer file "Destination file :"
else ask "Destination file :"
if it is empty then exit mouseUp
TextRes Text,Type,it
else TextRes Text,Type
if first word of the Result is "Error"
then answer the result
else answer "Created resource : " & the Result
end mouseUp
-- part contents for card part 1
----- text -----
TextRes 1.4
by Frédéric RINALDI
DESCRIPTION
------------
TextRes allows to create any kind of text resource (STR, STR#, TEXT, etc) in a file.
SYNTAX
-------
TextRes <text>,<res type>[,<res ID>][,<res name>]
[,<fileName>][,<sep.char>][<replace>]
PARAMETERS
------------
<text> is the text that will be written as resource in the file.
<res type> is a four chars string, case sensitive, giving the resource type.
<res ID> is an integer. If not supplied, any free ID will be used.
<res name> defines the name of the created resource.
<fileName> is the pathname of the destination file. Default is current resource file.
<sep.char> is useful only with STR# resource creation, and allows to define the entries separator. Default is return.
<replace> is a boolean, making all previous resource(s) with same name or ID to be replaced by the new one. Default is TRUE.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If the supplied file name doesn't exist, it is created by the XCMD.
The XCMD returns <ID[,name]> of the new resource in the result.
ERRORS
-------
If an error occurs, TextRes can return :
"Error : Duplicate resource ID" (only if Replace = FALSE)
"Error : Duplicate resource name" (only if Replace = FALSE)
"Error : Missing or empty parameter(s)"
"Error : Bad resource type"
"Error : Out of memory"
"Error : Couldn't create resource"
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : AppleShare insufficient privileges"
HISTORY
--------
1.4 : 05/05/92
• Added <replace> param
1.3 : 03/09/92
• Write allowed in an already opened resource file
1.2 : 03/07/92
• Fixed parameters parsing
1.1 : 02/23/92
• First release
--------------------------------------------------------------------
This (these) external(s) is (are) FreeWare,allowing unlimited use in any non-commercial stack. You just need in this case to mention the author's name and copyright in your stack.
Any commercial use must be licensed and aknowledged by the author.
© F. Rinaldi - 1992
AppleLink: RINALDI1 CalvaCom : FR10 Compuserve : 71170,2111